#include <stdio.h>
int main(void)
{
	int x,y=0,k;
	scanf("%d",&x);
	while(x){
		k=x%10;
		y=y+k;
		x=x/10;
	}
	printf("%d\n",y);
	return 0;
}
